#include <iostream>
#include <sys/types.h>
#include <sys/ipc.h>
#include <sys/shm.h>
#include <unistd.h>
using namespace std;
int main()
{
    int key = ftok(".", 48);
    int shmid = shmget(key, 4069, IPC_CREAT);
    void* p = shmat(shmid,nullptr,0);
    char* chp = (char*)p;
    while(true)
    {
        sleep(1);
        cout<<chp<<endl;
    }
    return 0;
}